┌────────────────────────────────┐ │ ░░░ ░░▓ ░▓▓ ███ ▓▓░ ▓░░ │ │ ~ M O O N ~ │ └────────────────────────────────┘
prd-web-01.centraldc.gr
LOCATION:
/usr/share/pie/src/Platform/TargetPhp
☗ ROOT
↻ REFRESH
✎ EDIT FILE
EDITING: PhpizePath.php
<?php declare(strict_types=1); namespace Php\Pie\Platform\TargetPhp; use RuntimeException; use Symfony\Component\Process\Process; use function assert; use function file_exists; use function is_executable; use function preg_match; use function preg_replace; use function trim; /** * @internal This is not public API for PIE, so should not be depended upon unless you accept the risk of BC breaks * * @immutable */ final class PhpizePath { /** @param non-empty-string $phpizeBinaryPath */ public function __construct(public readonly string $phpizeBinaryPath) { } public static function looksLikeValidPhpize(string $phpizePathToCheck, string|null $forPhpApiVersion = null): bool { $phpizeAttempt = $phpizePathToCheck; // @todo if ($phpizeAttempt === '') { return false; } if (! file_exists($phpizeAttempt) || ! is_executable($phpizeAttempt)) { return false; } $phpizeProcess = new Process([$phpizeAttempt, '--version']); if ($phpizeProcess->run() !== 0) { return false; } if ( ! preg_match('/PHP Api Version:\s*(.*)/', $phpizeProcess->getOutput(), $m) || $m[1] === '' ) { return false; } return $forPhpApiVersion === null || $forPhpApiVersion === $m[1]; } public static function guessFrom(PhpBinaryPath $phpBinaryPath): self { $expectedApiVersion = $phpBinaryPath->phpApiVersion(); $phpizeAttempts = []; // Try to add `phpize` from path $whichPhpize = new Process(['which', 'phpize']); if ($whichPhpize->run() === 0) { $phpizeAttempts[] = trim($whichPhpize->getOutput()); } // Try to guess based on the `php` path itself $phpizeAttempts[] = preg_replace('((.*)php)', '$1phpize', $phpBinaryPath->phpBinaryPath); foreach ($phpizeAttempts as $phpizeAttempt) { assert($phpizeAttempt !== null); assert($phpizeAttempt !== ''); if (self::looksLikeValidPhpize($phpizeAttempt, $expectedApiVersion)) { return new self($phpizeAttempt); } } throw new RuntimeException('Could not find a suitable `phpize` binary, you may provide one using the "--with-phpize-path" option.'); } }
CANCEL
Name
Type
Size
Modified
Actions
↩ ..
DIR
—
—
📁 Exception/
DIR
—
2026-04-15 15:13
📄 PhpBinaryPath.php
PHP
17.5 KB
2026-04-14 00:00
EDIT
📄 PhpizePath.php
PHP
2.3 KB
2026-04-14 00:00
EDIT